import { request } from './request';

export async function getAllCourse() {
  return request('/api/course', {
    method: 'GET',
  })
}

export async function appendCourse(data: any) {
  return request('/api/course', {
    method: 'POST',
    data,
  })
}

export async function updateCourse(data: any) {
  return request(`/api/course/${data?.cId}`, {
    method: 'PUT',
    data,
  })
}

export async function destroyCourse(data: any) {
  return request(`/api/course/${data?.cId}`, {
    method: 'DELETE',
  })
}

export default {
  getAllCourse,
  appendCourse,
  updateCourse,
  destroyCourse,
};
